import json
class CTipblkInfo:
    def __init__(self,height,blkhash,storeFile):
        self.__height =height
        self.__blkhash =blkhash
        self.__storeFile=storeFile
    
    @property
    def height(self):
        return self.__height

    @height.setter
    def height(self,value):
        self.__height =value

    @property
    def blkhash(self):
        return self.__blkhash

    @blkhash.setter
    def blkhash(self,value):
        self.__blkhash =value
    
    @property
    def storeFile(self):
        return self.__storeFile

    @storeFile.setter
    def storeFile(self,value):
        self.__storeFile =value


   #Object——>jsonStr
    def serializeToJsonStr(self):
       sttr=json.dumps(self, default=lambda obj: obj.__dict__)
       return sttr.replace("_CTipblkInfo__","")

    #jsonStr——> Object
    @classmethod
    def deserializeFromJsonStr(cls,jsonStrobjectdata):
        d = json.loads(jsonStrobjectdata)
        #print(d['txins'])
        return  cls(d['height'],d['blkhash'],d['storeFile'])
       
    #Object——>Python Object
    def serializeToPyObject(self):
        return json.loads(self.serializeToJsonStr())
    
    #Python Object——>Object
    @classmethod
    def deserializeFromPyObject(cls,pyObject):
       return cls.deserializeFromJsonStr(json.dumps(pyObject))